#参数组
#接收N个位置参数，转换成元组的方式
def test(*args):
    print(args)

test(1,2,3,4,5,5)
test(*[1,2,4,5,5])  #args = tuple([1,2,4,5,5])

'''def test1(x,*args):
    print(x)
    print(*args)
test1(1,2,3,4,5,6,7)'''

#**kwargs:接收N个关键字参数，转换成字典的方式
def test2(**kwargs):
    print(kwargs)
    print(kwargs['name'])#键值对
    print(kwargs['age'])
    print(kwargs['sex'])
test2(name = 'ouyang',age=8,sex='male')
test2(**{'name':'ouyang','age':8,'sex':'male'})

def test3(name,**kwargs):
    print(name)
    print(kwargs)
# test3("ouyang",'xxx')#位置参数不行
test3('ouyang')

'''# def test4(name,**kwargs,age = 18):#参数组一定放最后面
def test4(name,age = 18,**kwargs):
    print(name)
    print(age)
    print(kwargs)
test4('ouyang',4,sex = 'male',hobby='tejjs',)
test4('ouyang',sex = 'male',hobby='tejjs',age=3)'''

def test5(name,age = 18,*args,**kwargs):
    print(name)
    print(age)
    print(args)
    print(kwargs)
test5('ouyang',age=32,sex='mm',hobby='you')
